package com.sc.nft.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.MallActivityShareTeam;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sc.nft.entity.dto.ActivityShareTeamPopUpDetailDTO;
import com.sc.nft.entity.dto.AdminMallActivityShareTeamPageDTO;
import com.sc.nft.entity.dto.MallActivityShareTeamDetailDTO;
import com.sc.nft.entity.dto.MallActivityShareTeamPageDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 分享购团队信息 Mapper 接口
 * </p>
 *
 * @author ligen
 * @since 2023-12-13
 */
public interface MallActivityShareTeamMapper extends BaseMapper<MallActivityShareTeam> {

    /**
     * 分享成团列表
     *
     * @param page
     * @param status
     * @return
     */
    Page<AdminMallActivityShareTeamPageDTO> getAdminMallActivityShareTeamPageDTO(Page page, @Param("activityShareId") Long activityShareId, @Param("status") Integer status);

    /**
     * 用户分享成团列表
     *
     * @param page
     * @param userId
     * @return
     */
    Page<MallActivityShareTeamPageDTO> getMallActivityShareTeamPageDTO(Page page, @Param("userId") Long userId);

    /**
     * 用户分享成团详情
     *
     * @param userId
     * @param teamId
     * @return
     */
    MallActivityShareTeamDetailDTO getMallActivityShareTeamDetailDTO(@Param("userId") Long userId, @Param("teamId") Long teamId);

    /**
     * 获取分享团队弹窗信息
     *
     * @param teamId
     * @return
     */
    ActivityShareTeamPopUpDetailDTO getActivityShareTeamPopUpDetailDTO(@Param("teamId") Long teamId);

    /**
     * 添加成团订单数量
     *
     * @param id
     * @return
     */
    Boolean addOrderNumById(@Param("id") Long id, @Param("count") Integer count);

    /**
     * 减少有效订单数量
     *
     * @param id
     * @return
     */
    Boolean subValidOrderNumById(@Param("id") Long id, @Param("count") Integer count);

    /**
     * 获取拼团结束的团队
     *
     * @return
     */
    List<MallActivityShareTeam> getList();
}
